import request from "./request";



export function addUserApi(data:any) {
    return request({
        url: "/admin/addUser",
        method: 'post',
        data
    })
}

export function addEnUser(data:any) {
    return request({
        url: "/admin/add_en_user",
        method: 'post',
        data
    })
}
export function updateInfo(data:any) {
    return request({
        url: "/admin/update_info",
        method: 'put',
        data
    })
}

export function updateEnUserInfo(data:any) {
    return request({
        url: "/admin/update_en_user_info",
        method: 'put',
        data
    })
}
export function getEnUserInfoByIdApi(params:any) {
    return request({
        url: "/admin/get_en_user_info_by_id",
        method: 'get',
        params
    })
}
export function getUserInfoByIdApi(params:any) {
    return request({
        url: "/admin/get_user_info_by_id",
        method: 'get',
        params
    })
}

export function deleteUserByUserIdApi(data:any) {
    return request({
        url: "/admin/del_user_by_id",
        method: 'delete',
        data
    })
}




export function getEnUserByNameApi(params:any) {
    return request({
        url: "/admin/get_en_user_list_by_name",
        method: 'get',
        params
    })

}
export function getExcelApi(params: any) {
    let exportUrl = '/api/excel/export?nickname=' + params.nickname + '&phone=' + params.phone+ '&name=' + params.name
    window.open(exportUrl, "_self");
}
export function getUserByInfoApi(params:any) {
    return request({
        url: "/admin/get_user_list_by_name",
        method: 'get',
        params
    })
}

export function getEnterpriseApi(params:any) {
    return request({
        url: "/admin/getEnterprise",
        method: 'get',
        params
    })
}
